package a09_JUC;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author quan
 * @Description 原子类
 * @Date 2023/5/18 15:31
 */
public class a04_Atomic {
    public static void main(String[] args) {
        AtomicInteger atomicInteger = new AtomicInteger();

        atomicInteger.getAndIncrement();//i++
        atomicInteger.incrementAndGet();//++i
        atomicInteger.getAndDecrement();//i--
        atomicInteger.decrementAndGet();//--i
        atomicInteger.getAndAdd(10);//i+10
    }
}
